#ifndef __PROJECT_H__
#define __PROJECT_H__

// Operating System definitions and config
#define _OS_NONE			0
#define _OS_UCOS2			1
#define _OS_FREERTOS		2
#define _OS_NUCLEUS			3

#define _OPERATING_SYSTEM	_OS_UCOS2

// Global definitions
#define TRUE		1
#define FALSE		0
#define NULL		0
#define STATUS_OK	0
#define STATUS_FAIL -1

#define GPL32_A		0x1
#define GPL32_B		0x2
#define GPL32_C		0x3
#define GPL32_GP10	0x10
#define GPL326XXB	0x17
#define GPL327XX	0x20
#define GPL328XX	0x30

#define GP15E		0x8000
#define MCU_VERSION GP15E

// By default, char is unsigned. It can be changed to signed by compiler option
typedef char				CHAR;
typedef unsigned char		BOOLEAN;
typedef unsigned char		INT8U;
typedef signed char			INT8S;
typedef unsigned short		INT16U;
typedef signed short		INT16S;
typedef unsigned int		INT32U;
typedef signed int			INT32S;
typedef float				FP32;
typedef long long			INT64S;
typedef unsigned long long	INT64U;
typedef double				FP64;
typedef signed short		SINT16;

typedef char				INT8;
typedef short				INT16;
typedef int					INT32;
typedef long long			INT64;

#ifndef __ALIGN_DEFINE__
#define __ALIGN_DEFINE__
#ifdef __ADS_COMPILER__
#define ALIGN32 __align(32)
#define ALIGN16 __align(16)
#define ALIGN8	__align(8)
#define ALIGN4	__align(4)
#else
#ifdef __CS_COMPILER__
#define ALIGN32 __attribute__((aligned(32)))
#define ALIGN16 __attribute__((aligned(16)))
#define ALIGN8	__attribute__((aligned(8)))
#define ALIGN4	__attribute__((aligned(4)))
#else
#define ALIGN32 __align(32)
#define ALIGN16 __align(16)
#define ALIGN8	__align(8)
#define ALIGN4	__align(4)
#endif
#endif
#endif
#ifndef __CS_COMPILER__
#define ASM(asm_code) \
	__asm \
	{ \
		asm_code \
	}	/*ADS embeded asm*/
#define IRQ		__irq
#define PACKED	__packed
#else
#define ASM(asm_code)	asm(#asm_code); /*ADS embeded asm*/
#define IRQ				__attribute__((interrupt))
#define PACKED			__attribute__((__packed__))
#endif

#endif // __PROJECT_H__
